ostree-repo-refs: Drop unused function "parse_rev_file".
authorGiuseppe Scrivano <gscrivan@redhat.com>
Thu, 5 Mar 2015 11:18:30 +0000 (12:18 +0100)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Fri, 6 Mar 2015 17:45:37 +0000 (18:45 +0100)
If it will be needed in future, it can be retrieved from the git
history.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
src/libostree/ostree-repo-refs.c

index 5588c8367f89b8421e842273b00c94d91d1c31c7..1122aec9687b0d3c495070fba0143855524a34d2 100644 (file)
@@ -122,73 +122,6 @@ write_checksum_file (GFile *parentdir,
   return ret;
 }
 
-
-static gboolean
-parse_rev_file (OstreeRepo     *self,
-                GFile          *f,
-                char          **sha256,
-                GError        **error) G_GNUC_UNUSED;
-
-static gboolean
-parse_rev_file (OstreeRepo     *self,
-                GFile          *f,
-                char          **sha256,
-                GError        **error)
-{
-  gboolean ret = FALSE;
-  GError *temp_error = NULL;
-  gs_free char *rev = NULL;
-
-  if ((rev = gs_file_load_contents_utf8 (f, NULL, &temp_error)) == NULL)
-    goto out;
-
-  if (rev == NULL)
-    {
-      if (g_error_matches (temp_error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
-        {
-          g_clear_error (&temp_error);
-        }
-      else
-        {
-          g_propagate_error (error, temp_error);
-          goto out;
-        }
-    }
-  else
-    {
-      g_strchomp (rev);
-    }
-
-  if (g_str_has_prefix (rev, "ref: "))
-    {
-      gs_unref_object GFile *ref = NULL;
-      char *ref_sha256;
-      gboolean subret;
-
-      ref = g_file_resolve_relative_path (self->local_heads_dir, rev + 5);
-      subret = parse_rev_file (self, ref, &ref_sha256, error);
-        
-      if (!subret)
-        {
-          g_free (ref_sha256);
-          goto out;
-        }
-      
-      g_free (rev);
-      rev = ref_sha256;
-    }
-  else 
-    {
-      if (!ostree_validate_checksum_string (rev, error))
-        goto out;
-    }
-
-  ot_transfer_out_value(sha256, &rev);
-  ret = TRUE;
- out:
-  return ret;
-}
-
 static gboolean
 find_ref_in_remotes (OstreeRepo         *self,
                      const char         *rev,